package com.vcredit.creditcat.enumtype.product.sd;


/**
 * 闪贷提现订单状态枚举
 */
public enum SDLoanOrderStatusEnum {
	
	APPLY(2, 8, "放款申请中"), // 放款审核中
	CLEAR(3, 13, "已结清"), // 已结清
	FEFUSE(-4, 9, "已解约"), // 放款审核未通过
	IN_LOAN(6, 10, "放款中"), // 放款审核通过
	FAIL_LOAN(7, 10, "放款失败"), // 放款审核通过
	LOANED(8, 11, "还款中"), // 还款中
	OVERDUE(9, 12, "已逾期"); // 还款逾期中
	
	private Integer orderStatus;
	
	private Integer auditResult;
	
	private String desc;

	private SDLoanOrderStatusEnum(Integer orderStatus, Integer auditResult, String desc) {
		this.orderStatus = orderStatus;
		this.auditResult = auditResult;
		this.desc = desc;
	}

	public Integer getOrderStatus() {
		return orderStatus;
	}

	public Integer getAuditResult() {
		return auditResult;
	}

	public String getDesc() {
		return desc;
	}
	
	public static Integer getAuditResultByOrderStatus(Integer orderStatus) {
		SDLoanOrderStatusEnum[] loanOrderStatusEnums = SDLoanOrderStatusEnum.values();
		for (SDLoanOrderStatusEnum loanOrderStatusEnum : loanOrderStatusEnums) {
			if(loanOrderStatusEnum.getOrderStatus().intValue() == orderStatus) {
				return loanOrderStatusEnum.getAuditResult();
			}
		}
		
		return null;
	}
}
